function getAvgTime(speed, length)  {

        var time = parseInt(length) / speed;
        var timestring = time.toString();
        var parts = timestring.split(".");
        if(!parts[1]) parts[1] = 0;
        var m1 = 0+"."+parts[1].toString();
        var m2 = m1 / 10 * 6;
        m2 = runde(m2,2);
        var m = m2.split(".");
        var time2 = parts[0] + "h " + m[1] + "m";
        document.getElementById('time').value = time2;

}

function runde(x, n) {
  if (n < 1 || n > 14) return false;
  var e = Math.pow(10, n);
  var k = (Math.round(x * e) / e).toString();
  if (k.indexOf('.') == -1) k += '.';
  k += e.toString().substring(1);
  return k.substring(0, k.indexOf('.') + n+1);
}


function submitform(pressbutton){
	if (pressbutton) {
		document.adminForm.task.value=pressbutton;
	}
	if (typeof document.adminForm.onsubmit == "function") {
		document.adminForm.onsubmit();
	}
	document.adminForm.submit();
}




